﻿using System;
using System.Web.Mvc;
using System.Web.Routing;

namespace RefLib.IOC
{
    public class IocControllerFactory : DefaultControllerFactory
    {
        protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
        {
            if (controllerType == null)
                return null;

            return SingletonContainer.Resolve<IController>(controllerType);
        }
    }
}
